
<div class="box_mid">
	<?php echo $this->Session->flash(); ?>
	<div class="box_mid_content">
		<div class="box_mid_content_top">
			<span class="style1">Add Question</span>
			<div style="clear: both;"></div>
		</div>
		<div class="hr"></div>
		<div class="box_mid_content_mid">
		<?php $idCkeditor = 'Content' ;?>
		<?= $this->Ajax->form(
							array('type' => 'POST',
								'options' => array(
									'model' => 'Question',
									'update' => 'MainContent',
									'url' => '/addQuestion',
									'indicator' => 'loading',
									'name'=>'frmQuestion',
									'enctype' => 'multipart/form-data',
									'onsubmit' => "return repare_submit('$idCkeditor')"
							))); ?>

			<div class="info">
				<?= $this->Form->input('question_type_id',
						array('div'=>false, 'label'=>'Question type', 'type'=> 'select', 'id'=>'idQT', 'options'=>$QuestionTypes))?>
			</div>
			<div class="info">
				<?= $this->Form->input('question_level_id',
						array('div'=>false, 'label'=>'Question level', 'type'=> 'select', 'id'=>'idQL', 'options'=>$QuestionLevels)); ?>
			</div>
			<div class="info" id="idAudioDiv">
				<?= $this->Upload->edit('Question', 
						$this->Form->input['audio_url'],
						array('update' => 'idAudioDiv','indicator' => 'loading', 'type' => 'POST', 'escape' => false)); ?>
			</div>
			<?= $this->Form->input('content', array('id'=>$idCkeditor));?>
			<?= $this->CKEditor->load($idCkeditor) ?>
			<?= $this->Form->end('Save'); ?>
		</div>
	</div>
</div>
<script>
$(document).ready(function() {
	$('#idQT').change(function(){
		if($('#idQT').val()==1){
			$('#idAudioDiv').show();
		}
		else{
			$('#idAudioDiv').hide();
			$('#idAudioField').attr({value: ''});
		}
	});
});
</script>
